---
title: Mem0
description: Agent memory management
---

import { BlockInfoCard } from "@/components/ui/block-info-card"

<BlockInfoCard 
  type="mem0"
  color="#181C1E"
  icon={true}
  iconSvg={`<svg className="block-icon"
      
      
      
      viewBox='0 0 108 108'
      fill='none'
      xmlns='http://www.w3.org/2000/svg'
    >
      <path
        fillRule='evenodd'
        fill='currentColor'
        clipRule='evenodd'
        d='M56.1537 8.9569C58.6168 8.9569 60.6135 6.96017 60.6135 4.49707C60.6135 2.03397 58.6168 0.0372314 56.1537 0.0372314C53.6906 0.0372314 51.6939 2.03397 51.6939 4.49707C51.6939 6.96017 53.6906 8.9569 56.1537 8.9569ZM38.4182 29.3537C37.2703 27.8698 36.3474 26.0164 36.833 24.2042C37.3186 22.392 39.0445 21.2483 40.7806 20.5372C42.9589 19.645 44.71 17.7815 45.3663 15.3323C46.4819 11.1688 44.0111 6.88914 39.8475 5.77352C35.684 4.6579 31.4044 7.12874 30.2887 11.2923C29.6325 13.7416 30.2173 16.2311 31.6578 18.093C32.8058 19.5768 33.7287 21.4301 33.2431 23.2423C32.7575 25.0544 31.0317 26.198 29.2955 26.909C27.1171 27.8012 25.3658 29.6647 24.7096 32.1141C23.5939 36.2776 26.0648 40.5572 30.2283 41.6728C34.3919 42.7885 38.6715 40.3176 39.7871 36.1541C40.4434 33.7049 39.8586 31.2155 38.4182 29.3537ZM86.1482 38.6257C84.3362 38.1402 82.483 39.063 80.9994 40.2109C79.1375 41.6515 76.6479 42.2364 74.1986 41.5801C70.035 40.4645 67.5642 36.1849 68.6798 32.0213C69.7954 27.8578 74.075 25.3869 78.2386 26.5026C80.6877 27.1588 82.5512 28.9099 83.4434 31.0881C84.1546 32.8243 85.2983 34.5504 87.1106 35.036C88.9228 35.5215 90.7761 34.5988 92.2601 33.4509C94.1219 32.0108 96.6111 31.4262 99.0601 32.0824C103.224 33.198 105.694 37.4776 104.579 41.6412C103.463 45.8047 99.1836 48.2755 95.0201 47.1599C92.5706 46.5036 90.707 44.7521 89.8148 42.5734C89.1039 40.8373 87.9604 39.1113 86.1482 38.6257ZM103.562 77.1769C100.514 80.2249 95.5723 80.2249 92.5243 77.1769C90.7315 75.3841 89.9933 72.9362 90.3095 70.6038C90.5616 68.7447 90.434 66.6783 89.1074 65.3517C87.7808 64.0251 85.7143 63.8976 83.8553 64.1497C81.5228 64.466 79.0748 63.7277 77.2819 61.9349C74.234 58.8869 74.234 53.9453 77.2819 50.8973C80.3299 47.8494 85.2715 47.8494 88.3195 50.8973C90.1127 52.6906 90.8509 55.1394 90.534 57.4724C90.2816 59.3311 90.4089 61.3973 91.7353 62.7236C93.0617 64.05 95.1279 64.1774 96.9867 63.9249C99.3197 63.6079 101.769 64.3461 103.562 66.1394C106.61 69.1873 106.61 74.129 103.562 77.1769ZM64.1201 96.0379C63.0045 100.201 65.4753 104.481 69.6389 105.597C73.8024 106.712 78.082 104.241 79.1977 100.078C79.854 97.6285 79.2691 95.139 77.8285 93.2771C76.6805 91.7934 75.7578 89.9402 76.2433 88.1282C76.7288 86.3162 78.4545 85.1727 80.1904 84.4617C82.3688 83.5695 84.1201 81.706 84.7764 79.2567C85.892 75.0932 83.4212 70.8136 79.2576 69.6979C75.0941 68.5823 70.8144 71.0531 69.6988 75.2167C69.0425 77.6661 69.6275 80.1558 71.0681 82.0177C72.2161 83.5013 73.1389 85.3545 72.6534 87.1665C72.1678 88.9784 70.4422 90.1219 68.7063 90.8328C66.5278 91.7249 64.7764 93.5885 64.1201 96.0379ZM28.837 99.7095C26.6818 95.9765 27.9607 91.2033 31.6937 89.048C33.8898 87.7801 36.4459 87.7008 38.6172 88.6104C40.3475 89.3353 42.3764 89.747 44.0011 88.809C45.6257 87.871 46.2836 85.908 46.521 84.047C46.8189 81.7117 48.1657 79.5377 50.3618 78.2697C54.0947 76.1145 58.868 77.3935 61.0232 81.1264C63.1784 84.8594 61.8994 89.6327 58.1665 91.7879C55.9707 93.0556 53.4149 93.1351 51.2438 92.2259C49.5133 91.5012 47.4842 91.0895 45.8595 92.0275C44.2347 92.9656 43.5767 94.9288 43.3391 96.7898C43.041 99.1248 41.6942 101.298 39.4984 102.566C35.7655 104.721 30.9922 103.442 28.837 99.7095ZM28.4865 71.1594C27.0029 72.3074 25.1498 73.2301 23.3379 72.7446C21.5259 72.2591 20.3825 70.5334 19.6716 68.7974C18.7795 66.6187 16.9159 64.8673 14.4664 64.2109C10.3028 63.0953 6.02323 65.5661 4.90761 69.7297C3.792 73.8932 6.26283 78.1728 10.4264 79.2885C12.8756 79.9447 15.365 79.3599 17.2268 77.9196C18.7106 76.7717 20.5639 75.8489 22.3759 76.3345C24.188 76.82 25.3316 78.5458 26.0426 80.2818C26.9349 82.4601 28.7983 84.2113 31.2476 84.8676C35.4111 85.9832 39.6907 83.5124 40.8064 79.3488C41.922 75.1853 39.4511 70.9056 35.2876 69.79C32.8381 69.1337 30.3484 69.7187 28.4865 71.1594ZM5.92479 34.1938C8.97272 31.1459 13.9144 31.1459 16.9623 34.1938C18.7553 35.9868 19.4935 38.4351 19.177 40.7677C18.9248 42.6264 19.0524 44.6924 20.3787 46.0188C21.7052 47.3453 23.7716 47.4727 25.6305 47.2203C27.9634 46.9035 30.412 47.6418 32.2051 49.4349C35.2531 52.4828 35.2531 57.4245 32.2051 60.4724C29.1572 63.5204 24.2155 63.5204 21.1676 60.4724C19.3746 58.6794 18.6364 56.231 18.9529 53.8983C19.2052 52.0397 19.0776 49.9737 17.7513 48.6474C16.4248 47.3209 14.3585 47.1935 12.4996 47.4459C10.1667 47.7627 7.71801 47.0245 5.92479 45.2313C2.87686 42.1834 2.87686 37.2417 5.92479 34.1938ZM65.4846 22.5615C63.8601 23.4994 63.2023 25.4621 62.965 27.3228C62.6672 29.6582 61.3204 31.8323 59.1242 33.1003C55.3912 35.2555 50.618 33.9765 48.4627 30.2436C46.3075 26.5106 47.5865 21.7374 51.3195 19.5821C53.5153 18.3144 56.0712 18.2349 58.2424 19.1443C59.9728 19.869 62.0019 20.2807 63.6267 19.3427C65.2513 18.4047 65.9093 16.4418 66.147 14.5809C66.4451 12.2461 67.7918 10.0725 69.9876 8.8048C73.7205 6.64959 78.4938 7.92858 80.649 11.6615C82.8042 15.3945 81.5252 20.1677 77.7923 22.323C75.596 23.591 73.0396 23.6702 70.8681 22.7603C69.138 22.0353 67.1091 21.6236 65.4846 22.5615ZM104.469 60.245C106.932 60.245 108.928 58.2483 108.928 55.7852C108.928 53.3221 106.932 51.3253 104.469 51.3253C102.006 51.3253 100.009 53.3221 100.009 55.7852C100.009 58.2483 102.006 60.245 104.469 60.245ZM96.2923 21.5931C96.2923 24.0562 94.2955 26.053 91.8324 26.053C89.3693 26.053 87.3726 24.0562 87.3726 21.5931C87.3726 19.13 89.3693 17.1333 91.8324 17.1333C94.2955 17.1333 96.2923 19.13 96.2923 21.5931ZM23.4484 20.1063C23.4484 22.5694 21.4516 24.5662 18.9885 24.5662C16.5254 24.5662 14.5287 22.5694 14.5287 20.1063C14.5287 17.6432 16.5254 15.6465 18.9885 15.6465C21.4516 15.6465 23.4484 17.6432 23.4484 20.1063ZM4.86563 60.245C7.32873 60.245 9.32546 58.2483 9.32546 55.7852C9.32546 53.3221 7.32873 51.3253 4.86563 51.3253C2.40253 51.3253 0.405792 53.3221 0.405792 55.7852C0.405792 58.2483 2.40253 60.245 4.86563 60.245ZM22.7052 89.2338C22.7052 91.6969 20.7084 93.6936 18.2453 93.6936C15.7822 93.6936 13.7855 91.6969 13.7855 89.2338C13.7855 86.7707 15.7822 84.7739 18.2453 84.7739C20.7084 84.7739 22.7052 86.7707 22.7052 89.2338ZM52.4373 107.817C54.9004 107.817 56.8971 105.82 56.8971 103.357C56.8971 100.894 54.9004 98.8971 52.4373 98.8971C49.9742 98.8971 47.9774 100.894 47.9774 103.357C47.9774 105.82 49.9742 107.817 52.4373 107.817ZM95.5487 90.7205C95.5487 93.1836 93.552 95.1803 91.0889 95.1803C88.6258 95.1803 86.6291 93.1836 86.6291 90.7205C86.6291 88.2574 88.6258 86.2606 91.0889 86.2606C93.552 86.2606 95.5487 88.2574 95.5487 90.7205ZM54.4752 68.5612C61.8667 68.5612 67.8587 62.5692 67.8587 55.1777C67.8587 47.7862 61.8667 41.7942 54.4752 41.7942C47.0837 41.7942 41.0917 47.7862 41.0917 55.1777C41.0917 62.5692 47.0837 68.5612 54.4752 68.5612Z'
      />
    </svg>`}
/>

{/* MANUAL-CONTENT-START:intro */}
[Mem0](https://mem0.ai) is a powerful memory management system designed specifically for AI agents. It provides a persistent, searchable memory store that enables agents to remember past interactions, learn from experiences, and maintain context across conversations and workflow executions.

With Mem0, you can:

- **Store agent memories**: Save conversation history, user preferences, and important context
- **Retrieve relevant information**: Use semantic search to find the most relevant past interactions
- **Build context-aware agents**: Enable your agents to reference past conversations and maintain continuity
- **Personalize interactions**: Tailor responses based on user history and preferences
- **Implement long-term memory**: Create agents that learn and adapt over time
- **Scale memory management**: Handle memory needs for multiple users and complex workflows

In Sim, the Mem0 integration enables your agents to maintain persistent memory across workflow executions. This allows for more natural, context-aware interactions where agents can recall past conversations, remember user preferences, and build upon previous interactions. By connecting Sim with Mem0, you can create agents that feel more human-like in their ability to remember and learn from past experiences. The integration supports adding new memories, searching existing memories semantically, and retrieving specific memory records. This memory management capability is essential for building sophisticated agents that can maintain context over time, personalize interactions based on user history, and continuously improve their performance through accumulated knowledge.
{/* MANUAL-CONTENT-END */}


## Usage Instructions

Integrate Mem0 into the workflow. Can add, search, and retrieve memories.



## Tools

### `mem0_add_memories`

Add memories to Mem0 for persistent storage and retrieval

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `userId` | string | Yes | User ID associated with the memory |
| `messages` | json | Yes | Array of message objects with role and content |
| `apiKey` | string | Yes | Your Mem0 API key |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `ids` | array | Array of memory IDs that were created |
| `memories` | array | Array of memory objects that were created |

### `mem0_search_memories`

Search for memories in Mem0 using semantic search

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `userId` | string | Yes | User ID to search memories for |
| `query` | string | Yes | Search query to find relevant memories |
| `limit` | number | No | Maximum number of results to return |
| `apiKey` | string | Yes | Your Mem0 API key |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `searchResults` | array | Array of search results with memory data, each containing id, data, and score |
| `ids` | array | Array of memory IDs found in the search results |

### `mem0_get_memories`

Retrieve memories from Mem0 by ID or filter criteria

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `userId` | string | Yes | User ID to retrieve memories for |
| `memoryId` | string | No | Specific memory ID to retrieve |
| `startDate` | string | No | Start date for filtering by created_at \(format: YYYY-MM-DD\) |
| `endDate` | string | No | End date for filtering by created_at \(format: YYYY-MM-DD\) |
| `limit` | number | No | Maximum number of results to return |
| `apiKey` | string | Yes | Your Mem0 API key |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `memories` | array | Array of retrieved memory objects |
| `ids` | array | Array of memory IDs that were retrieved |



## Notes

- Category: `tools`
- Type: `mem0`
